package lab03.test01;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class Test {
    public static void main(String[] args) {
        //写文件-字符流
        BufferedWriter writer=null;
        try {try {
            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
            String path="D:\\hello.text";
            writer=new BufferedWriter(new FileWriter(path));

            writer.write("hello,world!");
            writer.newLine();

            writer.write("12021522022");
            writer.newLine();

        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }


    }
}
